#pragma once
#include "GameSystem.hpp"
#include "Hierarchy.hpp"
#include "Transform.hpp"

namespace Typhoon {
	class TransformHierarchy : public GameSystem
	{
	public:
		TransformHierarchy();

	protected:

		void GameObjectAdded(GameObject* gameObject);
		void GameObjectRemoved(GameObject* gameObject);

	private:

		void WorldHasBecomeDirty(DirtyProperty<Transform*, Matrix4x4>* dirtyProperty);

		void CalcWorld(DirtyProperty<Transform*, Matrix4x4>::EventData& event);

		void ParentChanged(Property<Hierarchy*, GameObject*>::EventData event);

	};
}
